<?php $this->fetch('public/head') ?>
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this"><a href="<?php echo url('index') ?>">负责人列表</a></li>
            <li class=""><a href="<?php echo url('add') ?>">添加负责人</a></li>
        </ul>
        <div class="layui-tab-content">
            <form class="layui-form layui-form-pane" action="<?php echo url('index') ?>" method="get">
                <div class="layui-inline">
                    <label class="layui-form-label">关键词</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" value="<?php echo input('name') ?>" placeholder="请输入关键词" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>
            </form>
            <hr>

            <form action="" method="post" class="ajax-form">
                选中项：
                <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="<?php echo url('delete?id='.$v['id']) ?>">删除</button>
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                            <th style="width: 30px;">ID</th>
                            <th>姓名</th>
                            <th>当前状态</th>
                            <th>商城负责人</th>
                            <th>预约负责人</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach($list as $v): ?>
                            <tr>
                                <td><input type="checkbox" name="ids[]" value="<?php echo $v['id'] ?>"></td>
                                <td><?php echo $v['id'] ?></td>
                                <td><?php echo $v['name']?></td>
                                <td>
                                    <?php if($v['status']==1): ?>
                                        <a href="<?php echo url('flag?id='.$v['id']) ?>" data-param="status=0" class="layui-btn layui-btn-xs ajax-post">启用</a>
                                    <?php else: ?>
                                        <a href="<?php echo url('flag?id='.$v['id']) ?>" data-param="status=1" class="layui-btn layui-btn-danger layui-btn-xs ajax-post">停用</a>
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <?php if($v['shangcheng']==1): ?>
                                        是
                                    <?php else: ?>
                                       否
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <?php if($v['yuyue']==1): ?>
                                        是
                                    <?php else: ?>
                                        否
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <a href="<?php echo url('edit?id='.$v['id']) ?>" class="layui-btn layui-btn-normal layui-btn-xs">编辑</a>
                                    <a href="<?php echo url('delete?id='.$v['id']) ?>" class="layui-btn layui-btn-danger layui-btn-xs ajax-delete">删除</a>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                    <!--分页-->
                    <?php echo $list->render() ?>
                </div>
            </form>
        </div>
    </div>

<?php $this->fetch('public/script') ?>